/**
 * 1，消息免打扰的数据
 * @param {Object} id
 * @param {Object} type
 */
export function addMsgDisturbData(id, type) {
	return {
		id,
		type
	}
}

/**
 * 2，资料更改数据
 * @param {Object} id 
 * @param {Object} type
 * @param {Object} updateType
 * @param {Object} updateData
 */
export function updateInfoData(id, type, updateType, updateData) {
	return {
		id,
		type,
		updateType,
		updateData
	}
}

/**
 * 3，消息列表数据
 * @param {Object} id 聊天对象id
 * @param {Object} type 聊天对象type
 * @param {Object} nickname 聊天对象昵称
 * @param {Object} head 聊天对象头像
 * @param {Object} news 最新一条消息
 * @param {Object} time 最新一条消息时间
 * @param {Object} msgNum 新消息数量
 * @param {Object} msgType 最新一条消息类型
 * @param {Object} msgId 消息主键id
 */
export function msgHomeData(id, type, nickname, head, news, time, msgNum, msgType, msgId) {
	//console.log(msgType)
	if (msgType == 2) {
		news = '图片'
	} else if (msgType == 3) {
		news = '语音'
	} else if (msgType == 4) {
		news = '红包'
	} else if (msgType == 5) {
		news = '地址'
	} else if (msgType == 21) {
		news = '抢到红包'
	} else if (msgType == 16) {
		news = JSON.parse(news).msg
	}

	var msgList = {
		id,
		type,
		nickname,
		head,
		news,
		time,
		msgNum,
		msgType,
		msgId
	}
	return msgList
}

/**
 * 4，聊天室对象
 * @param {Object} msgId 消息主键
 * @param {Object} tip 消息递增数
 * @param {Object} news 新消息
 * @param {Object} sendId 发送人id
 * @param {Object} sendHead 发送人头像
 * @param {Object} sendNickname 发送人昵称
 * @param {Object} msgType 消息类型
 * @param {Object} time 时间
 * @param {Object} chatType 聊天类型
 * @param {Object} chatId 聊天对象id
 * @param {Object} isRedRead 红包已读id
 * @param {Object} redPkgId 红包id
 */
export function msgChatData(msgId, tip, news, sendId, sendHead, sendNickname, msgType, time, chatType, chatId,
	redPkgId) {
	var msgList = {
		msgId,
		tip,
		news,
		sendId,
		sendHead,
		sendNickname,
		msgType,
		time,
		chatType,
		chatId,
		isRedRead: false,
		redPkgId: redPkgId || 0
	}
	return msgList
}

/**
 * 5，红包对象
 * @param {Object} sendId
 * @param {Object} sendName
 * @param {Object} redPkgId
 * @param {Object} robId
 * @param {Object} robName
 */
export function robHbMsg(sendId, sendName, redPkgId, robId, robName) {
	var robHbMsg = {
		sendId,
		sendName,
		redPkgId,
		robId,
		robName
	}
	return robHbMsg
}